/*
Copyright 2022 The Numaproj Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

// Code generated by Openapi Generator. DO NOT EDIT.

/// Gssapi : GSSAPI represents a SASL GSSAPI config

#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct Gssapi {
    /// valid inputs - KRB5_USER_AUTH, KRB5_KEYTAB_AUTH  Possible enum values:  - `\"KRB5_KEYTAB_AUTH\"` represents the password method KRB5KeytabAuth = \"KRB5_KEYTAB_AUTH\" = 2  - `\"KRB5_USER_AUTH\"` represents the password method KRB5UserAuth = \"KRB5_USER_AUTH\" = 1
    #[serde(rename = "authType")]
    pub auth_type: AuthType,
    #[serde(
        rename = "kerberosConfigSecret",
        skip_serializing_if = "Option::is_none"
    )]
    pub kerberos_config_secret: Option<k8s_openapi::api::core::v1::SecretKeySelector>,
    #[serde(rename = "keytabSecret", skip_serializing_if = "Option::is_none")]
    pub keytab_secret: Option<k8s_openapi::api::core::v1::SecretKeySelector>,
    #[serde(rename = "passwordSecret", skip_serializing_if = "Option::is_none")]
    pub password_secret: Option<k8s_openapi::api::core::v1::SecretKeySelector>,
    #[serde(rename = "realm")]
    pub realm: String,
    #[serde(rename = "serviceName")]
    pub service_name: String,
    #[serde(rename = "usernameSecret")]
    pub username_secret: k8s_openapi::api::core::v1::SecretKeySelector,
}

impl Gssapi {
    /// GSSAPI represents a SASL GSSAPI config
    pub fn new(
        auth_type: AuthType,
        realm: String,
        service_name: String,
        username_secret: k8s_openapi::api::core::v1::SecretKeySelector,
    ) -> Gssapi {
        Gssapi {
            auth_type,
            kerberos_config_secret: None,
            keytab_secret: None,
            password_secret: None,
            realm,
            service_name,
            username_secret,
        }
    }
}

/// valid inputs - KRB5_USER_AUTH, KRB5_KEYTAB_AUTH  Possible enum values:  - `\"KRB5_KEYTAB_AUTH\"` represents the password method KRB5KeytabAuth = \"KRB5_KEYTAB_AUTH\" = 2  - `\"KRB5_USER_AUTH\"` represents the password method KRB5UserAuth = \"KRB5_USER_AUTH\" = 1
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum AuthType {
    #[serde(rename = "KRB5_KEYTAB_AUTH")]
    KeytabAuth,
    #[serde(rename = "KRB5_USER_AUTH")]
    UserAuth,
}

impl Default for AuthType {
    fn default() -> AuthType {
        Self::KeytabAuth
    }
}
